package com.sample.FinalProject;

public abstract class Shape {
FinalView fv;	
int x, y, mockX, mockY, length, color, health, max_health, speed, age, damage, maintain, old_age;
boolean isEnemy, isElite;
public int getX(){
return x;	
}
public int getY(){
return y;	
}
public int getMockX(){
return mockX;	
}
public int getMockY(){
return mockY;	
}
public void setX(int newX){
x=newX;;	
}
public void setY(int newY){
y=newY;;	
}
public void setHealth(int newHealth){
health=newHealth;	
}
public int getLength(){
return length;	
}
public int getColor(){
return color;	
}
public int getAge(){
return age;	
}
public int getDamage(){
return damage;	
}
public int getSpeed(){
return speed;	
}
public int getHealth(){
return health;	
}
public boolean isEnemy(){
return isEnemy;	
}
public boolean isElite(){
return isElite;	
}
public int getMaxHealth(){
return max_health;	
}
public void maintain(){
if(health<max_health && maintain==3){	
maintain=0;
health++;	
}
else{
maintain++;	
}
if (age - old_age>=100){
old_age=age;
max_health*=1.1;
}
else{
age++;
}
}
public void move(int X, int Y){
if (X<(2*x+length)/2 && x>0){
x-=speed;	
mockX=x;
}
else if (X>(2*x+length)/2){
x+=speed;	
mockX=x;
}
if(Y-120<(2*y+length)/2 && y>0){
y-=speed;	
mockY=y;
}
else if (Y-120>(2*y+length)/2){
y+=speed;	
mockY=y;
}
}
public void move(int X, int Y, int tempSpeed){
if (X<(2*x+length)/2 && x>0){
x-=tempSpeed;	
mockX=x;
}
else if (X>(2*x+length)/2){
x+=tempSpeed;	
mockX=x;
}
if(Y-120<(2*y+length)/2 && y>0){
y-=tempSpeed;	
mockY=y;
}
else if (Y-120>(2*y+length)/2){
y+=tempSpeed;	
mockY=y;
}
}
public void mockMove(int X, int Y){
if (X<(2*x+length)/2 && x>0){
mockX-=speed;	
}
else if (X>(2*x+length)/2){
mockX+=speed;	
}
if(Y-120<(2*y+length)/2 && y>0){
mockY-=speed;	
}
else if (Y-120>(2*y+length)/2){
mockY+=speed;	
}
if(mockX<0){
mockX=0;	
}
if(mockY<0){
mockY=0;	
}	
}
public void mockUpdate(){
x=mockX;
y=mockY;
}
public void reverse(){
int xDirection=x-mockX;	
int yDirection=y-mockY;
if (xDirection<0 && yDirection<0){
x-=speed;
y-=speed;
}
else if (xDirection>0 && yDirection<0){
	x+=speed;
	y-=speed;	
}
else if (xDirection<0 && yDirection>0){
	x-=speed;
	y+=speed;	
}
else if(xDirection>0 && yDirection>0){
	x+=speed;
	y+=speed;	
}
}
}
